﻿//-------------------------------------------------------------------------------------------------------------------------------------
// Copyright (C) 2005 greatelsoft.com All Rights Reserved
//-------------------------------------------------------------------------------------------------------------------------------------

using System;
using System.Data.Common;
using System.Data;
using System.Data.OleDb;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using Pub.Class;
using GTS.MiniBox.Entity;

namespace GTS.MiniBox.Helper {
    /// <summary>
    /// 操作类
    /// 
    /// 修改纪录
    ///     2012-06-29 版本：1.0 系统自动创建此类
    /// 
    /// </summary>
    public partial class OriginCitySendMoneyHelper {

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="origin">批次列表</param>
        /// <param name="city">区域列表</param>
        /// <param name="dbkey"></param>
        /// <returns>删除是否成功</returns>
        public static bool DeleteByOriginCityList(string origin, string city, string dbkey = "") {
            string strSql = new SQL().Delete(OriginCitySendMoney._)
                .Where("1=1").Where(new Where()
                    .And(OriginCitySendMoney._OriginID, "(" + origin + ")", Operator.In)
                    .And(OriginCitySendMoney._CityCode, "(" + city + ")", Operator.In)
                ).ToString();
            int value = dbkey.IsNullEmpty() ? Data.ExecSql(strSql) : Data.Pool(dbkey).ExecSql(strSql);
            if (value != 1) return false;
            return true;
        }
    }
}

